{include file="public/header" /}
<body>
	<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
		<div class="layui-form-item">
			<label class="layui-form-label">角色</label>
			<div class="layui-input-block">
				<select name="RoleID" lay-filter="selectBtn">
					{foreach $data as $vo}
						{if condition="$vo.ID eq $data1.RoleID"}
							<option value=" {$vo.ID}" selected="selected">{$vo.Name}</option>
						{else /}
							<option value=" {$vo.ID}">{$vo.Name}</option>
						{/if}
					{/foreach}
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">用户名</label>
			<div class="layui-input-inline">
				<input type="text" name="UserName" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$data1.UserName}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label" lay-tips="留空则不更改">密码?</label>
			<div class="layui-input-inline">
				<input type="password" name="Password" placeholder="设置登陆密码" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">真实姓名</label>
			<div class="layui-input-inline">
				<input type="text" name="TrueName" lay-verify="required" placeholder="请输入真实姓名" autocomplete="off" class="layui-input" value="{$data1.TrueName}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">MAC</label>
			<div class="layui-input-inline">
				<input type="text" name="MAC" placeholder="请输入MAC" autocomplete="off" class="layui-input" value="{$data1.MAC}">
			</div>
		</div>
		<div class="layui-form-item layui-inline layui-col-lg-3">
			<label class="layui-form-label" lay-tips="角色后台登陆方式">登陆方式?</label>
			<div class="layui-input-inline">
				<?php if($data1['LoginType'] == 1){ ?>
					<input type="checkbox" name="LoginType" lay-skin="switch" lay-text="手机|密码" checked>
				<?php }else{ ?>
					<input type="checkbox" name="LoginType" lay-skin="switch" lay-text="手机|密码">
				<?php } ?>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">MAC验证</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="isMAC" lay-skin="switch" lay-text="启用|禁用" lay-filter="switch" <?php if($data1[ 'isMAC']=='1' ){echo 'checked';} ?>> <span style="font-size:12px;color:red;display: block;">开启验证只能在IE浏览器中进行验证,其他浏览器无法登录</span>
				<!-- <input type="checkbox" lay-filter="switch" name="Status" lay-skin="switch" lay-text="启用|禁用" checked>  -->
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-inline">
				{eq name="$data1.Status" value="1"}
					<input type="checkbox" lay-filter="switch" name="Status" lay-skin="switch" lay-text="启用|禁用" checked>
				{else/}
					<input type="checkbox" lay-filter="switch" name="Status" lay-skin="switch" lay-text="启用|禁用">
				{/eq}
			</div>
		</div>

		<input type="hidden" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="time" checked>

		<div class="layui-row layui-hide" id="TemplateField">
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">pv访问数</label>
				<div class="layui-input-inline">
					<?php if(in_array('pvNum',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="pvNum" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="pvNum">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">ua点击数</label>
				<div class="layui-input-inline">
					<?php if(in_array('uaNum',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="uaNum" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="uaNum">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">注册数量</label>
				<div class="layui-input-inline">
					<?php if(in_array('zcNum',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="zcNum" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="zcNum">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">申请人数</label>
				<div class="layui-input-inline">
					<?php if(in_array('sqNum',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="sqNum" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="sqNum">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">放款人数</label>
				<div class="layui-input-inline">
					<?php if(in_array('fkNum',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="fkNum" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="fkNum">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">申请率</label>
				<div class="layui-input-inline">
					<?php if(in_array('sqLv',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="sqLv" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="sqLv">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">放款率</label>
				<div class="layui-input-inline">
					<?php if(in_array('fkLv',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="fkLv" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="fkLv">
					<?php } ?>
				</div>
			</div>
			<div class="layui-form-item layui-inline layui-col-lg-3">
				<label class="layui-form-label">注册到uv率</label>
				<div class="layui-input-inline">
					<?php if(in_array('zcUvLv',$data1['TemplateField'])){ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="zcUvLv" checked>
					<?php }else{ ?>
						<input type="checkbox" name="TemplateField[]" lay-skin="switch" lay-text="显示|隐藏" value="zcUvLv">
					<?php } ?>
				</div>
			</div>
		</div>

		<input type="hidden" name="ID" lay-verify="required" placeholder="隐藏域 编辑用户ID" autocomplete="off" class="layui-input" value="{$data1.ID}">
		<div class="layui-form-item layui-hide">
			<button class="layui-btn" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit">提交</button>
		</div>
	</div>
</body>

{include file="public/footer" /}
<script>
	layui.use(['form'], function() {
		var $ = layui.$,
			form = layui.form;

		//监听select表单事件 如果角色ID等于贷超 显示可控制字段 否则隐藏html显示
		form.on('select(selectBtn)', function(data){
			if(data.value == 48){
				$("#TemplateField").removeClass('layui-hide');
			}else{
				$("#TemplateField").addClass('layui-hide');
			}
		});

	});

	var roleID = {$data1.RoleID};
	if(roleID == 48){
		$("#TemplateField").removeClass('layui-hide');
	}else{
		$("#TemplateField").addClass('layui-hide');
	}

</script>
